package com.zjbd.douyangcommoncore.config;

import com.github.houbb.sensitive.word.bs.SensitiveWordBs;
import com.github.houbb.sensitive.word.support.deny.WordDenys;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 屏蔽词官方配置
 */
@Configuration
public class SensitiveWordConfig {

    @Bean
    public SensitiveWordBs sensitiveWordBs(){
        return SensitiveWordBs.newInstance()
                .ignoreCase(true) //忽略大小写
                .ignoreWidth(true) //忽略半角和圆角
                .wordDeny(WordDenys.chains( //屏蔽词合并
                        WordDenys.defaults(),//默认屏蔽词
                        new MyWordDenyConfig()//自定义屏蔽词
                )) //默认屏蔽词
                .init();
    }
}
